<template>
  <!-- 特征权重分析 -->
  <j-modal
    :title="'权重分析'"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleCancel"
    :fullscreen="true"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <div v-if="isShowData">
        <a-row :gutter="[24, 8]">
          <a-col :span="10">
            <a-card>
              <a-table
                ref="table"
                size="middle"
                bordered
                rowKey="id"
                class="j-table-force-nowrap"
                :scroll="{ x: true, Y: 240 }"
                :columns="columns"
                :dataSource="dataSource"
                :pagination="false"
                :loading="loading"
                @change="handleTableChange"
              >
              </a-table>
            </a-card>
          </a-col>
          <a-col :span="14">
            <a-card>
              <pie title="" :height="height" :dataSource="pieDataSource" />
            </a-card>
          </a-col>
        </a-row>
      </div>
      <div v-else></div>
    </a-spin>
  </j-modal>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import '@/assets/less/TableExpand.less'
import splitPane from 'vue-splitpane'
import Pie from '@/components/chart/Pie'
export default {
  name: 'DataSetBuild',
  mixins: [JeecgListMixin],
  components: {
    splitPane,
    Pie,
  },
  data() {
    return {
      description: '特征值权重分析',
      isShowData: false,
      confirmLoading: false,
      height: 567,
      width: 1100,
      visible: false,
      pieDataSource: [
        // { item: '电压', count: 25 },
        // { item: '电流', count: 21 },
        // { item: '电阻', count: 17 },
        // { item: '滤波电阻', count: 13 },
        // { item: '平滑电阻', count: 9 },
        //  { item: '针振', count: 3 },
        //   { item: '摆动', count: 7 },
        //    { item: '斜率', count: 5 },
        {
          item: '电流',
          count: 5,
        },
        {
          item: '电压',
          count: 5,
        },
        {
          item: '电阻',
          count: 5,
        },
        {
          item: '滤波电阻',
          count: 5,
        },
        {
          item: '平滑电阻',
          count: 5,
        },
        {
          item: '针震值',
          count: 5,
        },
        {
          item: '摆动值',
          count: 5,
        },
        {
          item: '斜率mv',
          count: 5,
        },
        {
          item: '累斜',
          count: 5,
        },
        {
          item: '下料间隔时间',
          count: 5,
        },
        {
          item: '纯手动操作状态',
          count: 5,
        },
        {
          item: '电压上限',
          count: 5,
        },
        {
          item: '电压下限',
          count: 5,
        },
        {
          item: '设定下料间隔',
          count: 5,
        },
        {
          item: '效应距今',
          count: 5,
        },
        {
          item: '母綫位移狀態',
          count: 5,
        },
        {
          item: '当前的设定电压值',
          count: 5,
        },
        {
          item: '下料模式',
          count: 3,
        },
        {
          item: '母线位移值',
          count: 2,
        },
        {
          item: '正常下料次数',
          count: 5,
        },
        {
          item: '阳极位移01',
          count: 4,
        },
        {
          item: '阳极位移02',
          count: 1,
        },
      ],
      /* 排序参数 */
      isorter: {
        column: 'createTime',
        order: 'asc',
      },
      ipagination: {
        simple: true,
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: false,
        showSizeChanger: false,
        total: 0,
      },
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '特征值',
          align: 'center',
          width: 180,
          dataIndex: 'propName',
        },
        {
          title: '权重',
          align: 'center',
          dataIndex: 'value',
        },
      ],
      url: {
        //list: '/dataProperty/dataProperty/list',
        delete: '/userFormula/userFormula/delete',
        deleteBatch: '/userFormula/userFormula/deleteBatch',
        exportXlsUrl: '/userFormula/userFormula/exportXls',
        importExcelUrl: 'userFormula/userFormula/importExcel',
      },
      dictOptions: {},
      superFieldList: [],
      dataSource: [],
    }
  },
  created() {},
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    loadData(arg) {},
    show() {
      this.visible = true
      this.confirmLoading = false
      this.dataSource = [
        {
          propName: '电流',
          value: '5',
        },
        {
          propName: '电压',
          value: '5',
        },
        {
          propName: '电阻',
          value: '5',
        },
        {
          propName: '滤波电阻',
          value: '5',
        },
        {
          propName: '平滑电阻',
          value: '5',
        },
        {
          propName: '针震值',
          value: '5',
        },
        {
          propName: '摆动值',
          value: '5',
        },
        {
          propName: '斜率mv',
          value: '5',
        },
        {
          propName: '累斜',
          value: '5',
        },
        {
          propName: '下料间隔时间',
          value: '5',
        },
        {
          propName: '纯手动操作状态',
          value: '5',
        },
        {
          propName: '电压上限',
          value: '5',
        },
        {
          propName: '电压下限',
          value: '5',
        },
        {
          propName: '设定下料间隔',
          value: '5',
        },
        {
          propName: '效应距今',
          value: '5',
        },
        {
          propName: '母綫位移狀態',
          value: '5',
        },
        {
          propName: '当前的设定电压值',
          value: '5',
        },
        {
          propName: '下料模式',
          value: '3',
        },
        {
          propName: '母线位移值',
          value: '2',
        },
        {
          propName: '正常下料次数',
          value: '5',
        },
        {
          propName: '阳极位移01',
          value: '4',
        },
        {
          propName: '阳极位移02',
          value: '1',
        },
      ]
      this.handleAnalyse()
    },
    initDictConfig() {},
    handleAnalyse() {
      var that = this
      this.confirmLoading = true
      setTimeout(() => {
        that.isShowData = true
        that.confirmLoading = false
      }, 2000)
    },

    close() {
      this.$emit('close')
      this.visible = false
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>